<?php
header("Access-Control-Allow-Origin","*");
session_start();
    
    $username = $_POST['username'];
    $password = $_POST['password'];
    if(!preg_match("/^[a-zA-Z0-9]{4,10}$/",$username)){
        echo "9998";
    }
    else if(!preg_match("/^[a-zA-Z0-9]{6,10}$/",$password)){
        echo "9999";
    }
    else{
    
            require './userBiao.php';
            
            $aa = new userBiao();

            $sql = "SELECT NAME,PASSWORD from `user` WHERE `name`= '$username' AND `password`= '$password'";
            
            $result = $aa->getone($sql);
            
            if($result){
                
                echo $aa->getJSON('10001',$result);
            }

    }


?>